<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/

empty($do) && $do = 'list';
if ($do == 'edit') {
	$id = getGP('id','G','int');
	$user = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."web  WHERE id = '$id'");
	//$purview = unserialize($usergroup['flag']);
	include_once('template/ewebedit.php');

} elseif ($do == 'save') {
	
	$savetype = getGP('savetype','P');
	$id = getGP('id','P','int');
	$title = getGP('title','P');
	$weburl = getGP('weburl','P');
	$content = getGP('content','P');
	//主表信息
	$web = array(
		'title' => $title,
		'weburl' => $weburl,
		'content' => $content
	);
	update_db('web',$web, array('id' => $id));
	if($id!='')
	{
   $oalog = array(
		'uid' => $_USER->id,
		'title' => "修改收藏信息",
		'content' => $title.get_inc_log(1).$weburl.get_inc_log(1).$content,
		'startdate' => get_date('Y-m-d H:i:s',PHP_TIME),
		'contentid' => $id,
		'type' => '21'
	);
	insert_db('oalog',$oalog);
	
	}
	goto_page('admin.php?ac=eweb&fileurl=user');
}
?>